//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101
//#include "stdafx.h"
#include "AbcdCalibration.h"
using namespace Cephei::QL::Termstructures::Volatility;
#include <gen/QL/Math/Optimization/EndCriteria.h>
#include <gen/QL/Math/Optimization/OptimizationMethod.h>
using namespace Cephei::QL::Math::Optimization;
#undef HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (Cephei::IVector<Double>^ t, Cephei::IVector<Double>^ blackVols, Microsoft::FSharp::Core::FSharpOption<Double>^ aGuess, Microsoft::FSharp::Core::FSharpOption<Double>^ bGuess, Microsoft::FSharp::Core::FSharpOption<Double>^ cGuess, Microsoft::FSharp::Core::FSharpOption<Double>^ dGuess, Microsoft::FSharp::Core::FSharpOption<Boolean>^ aIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ bIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ cIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ dIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ vegaWeighted, Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IEndCriteria^>^ endCriteria, Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IOptimizationMethod^>^ method) 
{
	_pSpinlock = new boost::detail::spinlock ();
    CoVector<Double>^ _Ct;
    CoVector<Double>^ _CblackVols;
    CEndCriteria^ _CendCriteria;
    COptimizationMethod^ _Cmethod;
    try
    {
#ifdef HANDLE
        _phAbcdCalibration = NULL;
#endif
        CoVector<Double>^ _Ct = safe_cast<CoVector<Double>^> (t);
        _Ct->Lock();
        INativeVector<Double>^ _NCIt = _Ct->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCt = safe_cast<CDoubleVector^>(_NCIt);
        std::vector<QuantLib::Real>& _t = static_cast<std::vector<QuantLib::Real>&> (_NCt->GetReference ());
        CoVector<Double>^ _CblackVols = safe_cast<CoVector<Double>^> (blackVols);
        _CblackVols->Lock();
        INativeVector<Double>^ _NCIblackVols = _CblackVols->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCblackVols = safe_cast<CDoubleVector^>(_NCIblackVols);
        std::vector<QuantLib::Real>& _blackVols = static_cast<std::vector<QuantLib::Real>&> (_NCblackVols->GetReference ());
        QuantLib::Real _aGuess = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (aGuess) ? (QuantLib::Real)ValueHelper::Convert (aGuess->Value) : -0.06); //4
        QuantLib::Real _bGuess = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (bGuess) ? (QuantLib::Real)ValueHelper::Convert (bGuess->Value) : 0.17); //4
        QuantLib::Real _cGuess = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (cGuess) ? (QuantLib::Real)ValueHelper::Convert (cGuess->Value) : 0.54); //4
        QuantLib::Real _dGuess = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (dGuess) ? (QuantLib::Real)ValueHelper::Convert (dGuess->Value) : 0.17); //4
        bool _aIsFixed = 
            (Microsoft::FSharp::Core::FSharpOption<Boolean>::IsSome::get (aIsFixed) ? (bool)ValueHelper::Convert (aIsFixed->Value) : false); //4
        bool _bIsFixed = 
            (Microsoft::FSharp::Core::FSharpOption<Boolean>::IsSome::get (bIsFixed) ? (bool)ValueHelper::Convert (bIsFixed->Value) : false); //4
        bool _cIsFixed = 
            (Microsoft::FSharp::Core::FSharpOption<Boolean>::IsSome::get (cIsFixed) ? (bool)ValueHelper::Convert (cIsFixed->Value) : false); //4
        bool _dIsFixed = 
            (Microsoft::FSharp::Core::FSharpOption<Boolean>::IsSome::get (dIsFixed) ? (bool)ValueHelper::Convert (dIsFixed->Value) : false); //4
        bool _vegaWeighted = 
            (Microsoft::FSharp::Core::FSharpOption<Boolean>::IsSome::get (vegaWeighted) ? (bool)ValueHelper::Convert (vegaWeighted->Value) : false); //4
        if (Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IEndCriteria^>::IsSome::get (endCriteria))
        {
            _CendCriteria = safe_cast<CEndCriteria^> (endCriteria->Value);
            _CendCriteria->Lock();
        }
        boost::shared_ptr<QuantLib::EndCriteria>& _endCriteria = 
            (Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IEndCriteria^>::IsSome::get (endCriteria) ? static_cast<boost::shared_ptr<QuantLib::EndCriteria>&> (_CendCriteria->GetShared ()) : boost::shared_ptr<QuantLib::EndCriteria>()); //1
        if (Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IOptimizationMethod^>::IsSome::get (method))
        {
            _Cmethod = safe_cast<COptimizationMethod^> (method->Value);
            _Cmethod->Lock();
        }
        boost::shared_ptr<QuantLib::OptimizationMethod>& _method = 
            (Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IOptimizationMethod^>::IsSome::get (method) ? static_cast<boost::shared_ptr<QuantLib::OptimizationMethod>&> (_Cmethod->GetShared ()) : boost::shared_ptr<QuantLib::OptimizationMethod>()); //1
        _ppAbcdCalibration = new boost::shared_ptr<QuantLib::AbcdCalibration> (new QuantLib::AbcdCalibration ( _t,  _blackVols,  _aGuess,  _bGuess,  _cGuess,  _dGuess,  _aIsFixed,  _bIsFixed,  _cIsFixed,  _dIsFixed,  _vegaWeighted,  _endCriteria,  _method ));
        
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Ct != nullptr) _Ct->Unlock();
        if (_CblackVols != nullptr) _CblackVols->Unlock();
        if (_CendCriteria != nullptr) _CendCriteria->Unlock();
        if (_Cmethod != nullptr) _Cmethod->Unlock();
    }
}
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration () 
{
	_pSpinlock = new boost::detail::spinlock ();
    try
    {
#ifdef HANDLE
        _phAbcdCalibration = NULL;
#endif
        _ppAbcdCalibration = new boost::shared_ptr<QuantLib::AbcdCalibration> (new QuantLib::AbcdCalibration ( ));
        
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (boost::shared_ptr<QuantLib::AbcdCalibration>& childNative, Object^ owner) 
{
	_pSpinlock = new boost::detail::spinlock ();
#ifdef HANDLE
	_phAbcdCalibration = NULL;
#endif
	_ppAbcdCalibration = &childNative;
    
}
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (QuantLib::AbcdCalibration& childNative, Object^ owner) 
{
#ifdef HANDLE
	_phAbcdCalibration = NULL;
#endif
	_ppAbcdCalibration = new boost::shared_ptr<QuantLib::AbcdCalibration> (&childNative);
    
    _AbcdCalibrationOwner = owner;
    
}

Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (CAbcdCalibration^ copy) 
{
	_pSpinlock = new boost::detail::spinlock ();
#ifdef HANDLE
	_phAbcdCalibration = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppAbcdCalibration = new boost::shared_ptr<QuantLib::AbcdCalibration> (copy->GetShared());
        
    }
}
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (System::Type^ t) 
{
	_pSpinlock = new boost::detail::spinlock ();
#ifdef HANDLE
	_phAbcdCalibration = NULL;
#endif
	if (!t->IsSubclassOf(CAbcdCalibration::typeid))
		throw gcnew Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (QuantLib::Handle<QuantLib::AbcdCalibration>& childNative, Object^ owner)  
{
	_pSpinlock = new boost::detail::spinlock ();
	_phAbcdCalibration = &childNative;
	_ppAbcdCalibration = &static_cast<boost::shared_ptr<QuantLib::AbcdCalibration>>(childNative.currentLink());
    
    _AbcdCalibrationOwner = owner;
}
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (QuantLib::Handle<QuantLib::AbcdCalibration> childNative)  
{
	_pSpinlock = new boost::detail::spinlock ();
	_phAbcdCalibration = &childNative;
	_ppAbcdCalibration = &static_cast<boost::shared_ptr<QuantLib::AbcdCalibration>>(childNative.currentLink());
    
}
#endif
#ifdef STRUCT
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::CAbcdCalibration (QuantLib::AbcdCalibration childNative)  
{
	_pSpinlock = new boost::detail::spinlock ();
#ifdef HANDLE
	_phAbcdCalibration = NULL;
#endif
	_ppAbcdCalibration = new boost::shared_ptr<QuantLib::AbcdCalibration> (new QuantLib::AbcdCalibration (childNative));
    
}
#endif

Cephei::QL::Termstructures::Volatility::CAbcdCalibration::~CAbcdCalibration ()
{
	if (_pSpinlock != NULL)
    {
        delete _pSpinlock;
        _pSpinlock = NULL;
    }
    if (_ppAbcdCalibration != NULL)
    {
	    delete _ppAbcdCalibration;
        _ppAbcdCalibration = NULL;
    }
}
Cephei::QL::Termstructures::Volatility::CAbcdCalibration::!CAbcdCalibration ()
{
	if (_pSpinlock != NULL)
    {
        delete _pSpinlock;
    }
    if (_ppAbcdCalibration != NULL)
    {
	    delete _ppAbcdCalibration;
    }
}
QuantLib::AbcdCalibration& Cephei::QL::Termstructures::Volatility::CAbcdCalibration::GetReference ()
{
    if (_ppAbcdCalibration == NULL) throw gcnew NativeNullException ();
	return **_ppAbcdCalibration;
}
boost::shared_ptr<QuantLib::AbcdCalibration>& Cephei::QL::Termstructures::Volatility::CAbcdCalibration::GetShared ()
{
    if (_ppAbcdCalibration == NULL) throw gcnew NativeNullException ();
	return *_ppAbcdCalibration;
}
QuantLib::AbcdCalibration* Cephei::QL::Termstructures::Volatility::CAbcdCalibration::GetPointer ()
{
    if (_ppAbcdCalibration == NULL) throw gcnew NativeNullException ();
	return &**_ppAbcdCalibration;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::AbcdCalibration>& Cephei::QL::Termstructures::Volatility::CAbcdCalibration::GetHandle ()
{
	if (_phAbcdCalibration == NULL)
	{
		_phAbcdCalibration = new Handle<QuantLib::AbcdCalibration> (*_ppAbcdCalibration);
	}
	return *_phAbcdCalibration;
}
#endif
bool Cephei::QL::Termstructures::Volatility::CAbcdCalibration::HasNative () 
{
	return (_ppAbcdCalibration != NULL);
}

Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::A::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->a ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::B::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->b ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::C::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->c ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::Volatility::IAbcdCalibration^ Cephei::QL::Termstructures::Volatility::CAbcdCalibration::Compute::get ()
{
    try
    {
    	boost::detail::spinlock::scoped_lock lock (*_pSpinlock);
    	(*_ppAbcdCalibration)->compute ( );
    	return this;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::D::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->d ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
QL::Math::Optimization::EndCriteria::TypeEnum Cephei::QL::Termstructures::Volatility::CAbcdCalibration::EndCriteria::get ()
{
    try
    {
    	QuantLib::EndCriteria::Type _rv = (QuantLib::EndCriteria::Type)(*_ppAbcdCalibration)->endCriteria ( );   
        QL::Math::Optimization::EndCriteria::TypeEnum _nrv = (QL::Math::Optimization::EndCriteria::TypeEnum)_rv;
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::Error::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->error ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::IVector<Double>^ Cephei::QL::Termstructures::Volatility::CAbcdCalibration::K (Cephei::IVector<Double>^ t, Cephei::IVector<Double>^ blackVols)
{
    CoVector<Double>^ _Ct;
    CoVector<Double>^ _CblackVols;
    try
    {
        _Ct = safe_cast<CoVector<Double>^> (t);
        _Ct->Lock();
        INativeVector<Double>^ _NCIt = _Ct->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCt = safe_cast<CDoubleVector^>(_NCIt);
        std::vector<QuantLib::Real>& _t = static_cast<std::vector<QuantLib::Real>&> (_NCt->GetReference ());
        _CblackVols = safe_cast<CoVector<Double>^> (blackVols);
        _CblackVols->Lock();
        INativeVector<Double>^ _NCIblackVols = _CblackVols->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCblackVols = safe_cast<CDoubleVector^>(_NCIblackVols);
        std::vector<QuantLib::Real>& _blackVols = static_cast<std::vector<QuantLib::Real>&> (_NCblackVols->GetReference ());
    	std::vector<QuantLib::Real> _rv = (std::vector<QuantLib::Real>)(*_ppAbcdCalibration)->k ( _t,  _blackVols );   
        Cephei::IVector<Double>^ _nrv = gcnew CoVector<Double> (gcnew CDoubleVector (_rv));
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Ct != nullptr) _Ct->Unlock();
        if (_CblackVols != nullptr) _CblackVols->Unlock();
    }
}
Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::MaxError::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->maxError ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Termstructures::Volatility::CAbcdCalibration::Value (Double x)
{
    try
    {
        QuantLib::Real _x = (QuantLib::Real)ValueHelper::Convert (x);
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppAbcdCalibration)->value ( _x );   
        Double _nrv = (Double)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

Cephei::QL::Termstructures::Volatility::IAbcdCalibration^ Cephei::QL::Termstructures::Volatility::CAbcdCalibration_Factory::Create (Cephei::IVector<Double>^ t, Cephei::IVector<Double>^ blackVols, Microsoft::FSharp::Core::FSharpOption<Double>^ aGuess, Microsoft::FSharp::Core::FSharpOption<Double>^ bGuess, Microsoft::FSharp::Core::FSharpOption<Double>^ cGuess, Microsoft::FSharp::Core::FSharpOption<Double>^ dGuess, Microsoft::FSharp::Core::FSharpOption<Boolean>^ aIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ bIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ cIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ dIsFixed, Microsoft::FSharp::Core::FSharpOption<Boolean>^ vegaWeighted, Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IEndCriteria^>^ endCriteria, Microsoft::FSharp::Core::FSharpOption<Cephei::QL::Math::Optimization::IOptimizationMethod^>^ method)
{
    return gcnew CAbcdCalibration ( t,  blackVols,  aGuess,  bGuess,  cGuess,  dGuess,  aIsFixed,  bIsFixed,  cIsFixed,  dIsFixed,  vegaWeighted,  endCriteria,  method);
}
Cephei::QL::Termstructures::Volatility::IAbcdCalibration^ Cephei::QL::Termstructures::Volatility::CAbcdCalibration_Factory::Create ()
{
    return gcnew CAbcdCalibration ();
}
